package data

import (
	"crypto/md5"
	"fmt"
	"time"
)

func CreateUuid(user string) string {
	return fmt.Sprintf("%x", md5.Sum([]byte(user+time.Now().String())))
}

func CreateSessionByUser(user string) *Session {
	return &Session{
		user, CreateUuid(user), time.Now(),
	}
}

type Session struct {
	User      string
	Uuid      string
	CreatedAt time.Time
}

func (s *Session) Check() bool {
	return true
}
